#ifndef BATTERY_STATE_H
#define BATTERY_STATE_H

#include <QtCore>

//电池状态(0x1111(十4369)禁充 0x2222(十8738)禁放 0x5555(十21845)告警 0xAAAA(十43690)故障 0xBBBB(十48059)正常)
class CBatteryState
{
private:
    CBatteryState() = default;
    ~CBatteryState() = default;

public:
    enum eBatteryState{
        FORBID_CHARGE                       = 0x1111, //0x1111(十4369)禁充
        FORBID_DISCHARGE                    = 0x2222, //0x2222(十8738)禁放
        ALARM                               = 0x5555, //0x5555(十21845)告警
        FAULT                               = 0xAAAA, //0xAAAA(十43690)故障
        NORMAL                              = 0xBBBB, //0xBBBB(十48059)正常
        WARN                                = 0xCCCC, //0xCCCC(十52428)预警
    };

public:
    //获取英文名称(主要供调试用)
    static QString GetName(int iBatteryState);
    //获取中文utf8(主要供界面显示)
    static QString GetUtf8(int iBatteryState);

    //是不是禁止状态
    static bool IsForbid(int iBatteryState);
    //是不是禁充状态
    static bool IsForbidCharge(int iBatteryState);
    //是不是禁访状态
    static bool IsForbidDischarge(int iBatteryState);
    //是不是告警状态
    static bool IsAlarm(int iBatteryState);
    //是不是故障状态
    static bool IsFault(int iBatteryState);
    //是不是正常状态
    static bool IsNormal(int iBatteryState);
    //是不是预警状态
    static bool IsWarn(int iBatteryState);
};

#endif //BATTERY_STATE_H
